# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Stephen Smith <stephen304@gmail.com>

pkgbase=lua-inifile
_rockname=${pkgbase#lua-}
pkgname=("$pkgbase" "lua51-$_rockname" "lua52-$_rockname" "lua53-$_rockname")
pkgver=1.0
pkgrel=3
_rockrel=2
pkgdesc='a simple, complete ini parser for lua'
arch=(any)
url="https://github.com/bartbes/$_rockname"
license=(BSD)
makedepends=(lua
             lua51
             lua52
             lua53
             luarocks)
_archive="$_rockname-$pkgver"
source=("$url/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('5b9365c66145c3b4aeb0d997aff974e0acff60067a804adcf0ba05ead0e450fb')

_package() {
	cd "$_archive"
	depends=("${pkgname%-*}")
	luarocks --lua-version="$1" --tree="$pkgdir/usr/" \
		make --deps-mode=none --no-manifest "$_rockname-$pkgver-$_rockrel.rockspec"
}

package_lua-inifile() {
	_package 5.4
}

package_lua53-inifile() {
	_package 5.3
}

package_lua52-inifile() {
	_package 5.2
}

package_lua51-inifile() {
	_package 5.1
}
